 		function plugin0()
        {
            return document.getElementById('plugin0');
        }
        plugin = plugin0;
        function addEvent(obj, name, func)
        {
            if (obj.attachEvent) {
                obj.attachEvent("on"+name, func);
            } else {
                obj.addEventListener(name, func, false); 
            }
        }
        
        function load()
        {
            addEvent(plugin(), 'echo', function(msg){
                console.log(msg);
            });
        }
        function pluginLoaded() {
            alert("Plugin loaded!");
        }
        
        
        function pluginValid()
        {
            if(plugin().valid){
				init();				
            } else {
                alert("腕带或胸卡插件未激活");
            }
        }
		function init(){
			document.getElementById('plugin0').init_port(6);
		}
		function getVersion()
		{
			alert(document.getElementById('plugin0').version);
		}
		function closeCom(){
			document.getElementById('plugin0').close_port();
		}